<?php

namespace App\Http\Controllers;

use App\File;
use Illuminate\Http\Request;

use App\Http\Requests;

class FileController extends Controller
{
    public function file(Request $request)
    {
        $request->has('num') ? $num = $request['num'] : $num = 30;
        if ($request->has('type')) {
            $type = $request['type'];
        } else {
            $type = '';
        }
        $files = File::get_list($type)->paginate($num);
        return view('index.file', ['files' => $files]);
    }
}
